<template>
    <div style="height: 100%">
      <div class="main-tab">
        <div id="header">
          <x-header title="资讯" slot="header" :left-options="{showBack: false}" >
            <x-icon type="ios-arrow-back" slot="left" style="fill:#fff;" @click="back"></x-icon>
            <x-icon type="ios-search-strong" slot="right" style="fill:#fff;" @click="touch"></x-icon>
          </x-header>
          <div>
            <search
              @result-click="resultClick"
              @on-change="getResult"
              :results="results"
              v-model="value"
              position="absolute"
              auto-scroll-to-top
              top="46px"
              @on-focus="onFocus"
              @on-cancel="onCancel"
              @on-submit="onSubmit"
              ref="search" v-show="touch1"></search>
          </div>
        </div>
        <div class="main-headerAndTab">
          <tab bar-active-color="#AD2532" :line-width="2" custom-bar-width="1.43rem" active-color="#AD2532" default-color="#9B9B9B" :scroll-threshold="6">
            <tab-item selected  active-class="active1" @click.native="change1">全部</tab-item>
            <tab-item active-class="active1" @click.native="change2">趣闻</tab-item>
            <tab-item active-class="active1" @click.native="change3">酒经</tab-item>
            <tab-item active-class="active1" @click.native="change4">烟经</tab-item>
            <tab-item active-class="active1" @click.native="change5">红酒</tab-item>
            <tab-item active-class="active1" @click.native="change6">啤酒</tab-item>
          </tab>
          <group v-show="flag1">
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info2">
                <div class="info-tit">
                  <span>烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                </div>
                <div class="info2-img">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
                <div class="info2-bottom">
                  <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div>
                <video src="../../../static/video/movie.ogg" controls="controls" class="video"></video>
                <div class="video-tit"><span>JUUL电子烟套装评测：真那么好抽？</span></div>
                <div class="video-bottom">
                  <span class="video-date">2019-01-01<span class="video-time">09:00</span></span>
                  <span class="video-play"><span class="video-num">1万</span>次播放</span>
                </div>
              </div>
            </cell-box>
          </group>
          <group v-show="flag2">
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？2</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info2">
                <div class="info-tit">
                  <span>烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                </div>
                <div class="info2-img">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
                <div class="info2-bottom">
                  <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div>
                <video src="../../../static/video/movie.ogg" controls="controls" class="video"></video>
                <div class="video-tit"><span>JUUL电子烟套装评测：真那么好抽？</span></div>
                <div class="video-bottom">
                  <span class="video-date">2019-01-01<span class="video-time">09:00</span></span>
                  <span class="video-play"><span class="video-num">1万</span>次播放</span>
                </div>
              </div>
            </cell-box>
          </group>
          <group v-show="flag3">
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？3</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info2">
                <div class="info-tit">
                  <span>烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                </div>
                <div class="info2-img">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
                <div class="info2-bottom">
                  <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div>
                <video src="../../../static/video/movie.ogg" controls="controls" class="video"></video>
                <div class="video-tit"><span>JUUL电子烟套装评测：真那么好抽？</span></div>
                <div class="video-bottom">
                  <span class="video-date">2019-01-01<span class="video-time">09:00</span></span>
                  <span class="video-play"><span class="video-num">1万</span>次播放</span>
                </div>
              </div>
            </cell-box>
          </group>
          <group v-show="flag4">
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？4</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info2">
                <div class="info-tit">
                  <span>烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                </div>
                <div class="info2-img">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
                <div class="info2-bottom">
                  <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div>
                <video src="../../../static/video/movie.ogg" controls="controls" class="video"></video>
                <div class="video-tit"><span>JUUL电子烟套装评测：真那么好抽？</span></div>
                <div class="video-bottom">
                  <span class="video-date">2019-01-01<span class="video-time">09:00</span></span>
                  <span class="video-play"><span class="video-num">1万</span>次播放</span>
                </div>
              </div>
            </cell-box>
          </group>
          <group v-show="flag5">
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？5</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info2">
                <div class="info-tit">
                  <span>烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                </div>
                <div class="info2-img">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
                <div class="info2-bottom">
                  <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div>
                <video src="../../../static/video/movie.ogg" controls="controls" class="video"></video>
                <div class="video-tit"><span>JUUL电子烟套装评测：真那么好抽？</span></div>
                <div class="video-bottom">
                  <span class="video-date">2019-01-01<span class="video-time">09:00</span></span>
                  <span class="video-play"><span class="video-num">1万</span>次播放</span>
                </div>
              </div>
            </cell-box>
          </group>
          <group v-show="flag6">
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？6</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info">
                <div class="info-left">
                  <span class="info-tit">烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                  <div class="info-bottom">
                    <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                  </div>
                </div>
                <div class="info-right">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div class="info2">
                <div class="info-tit">
                  <span>烟民强烈推荐TOP10!你的口粮上榜了吗？</span>
                </div>
                <div class="info2-img">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                  <img src="../../../static/icon/timg.jpg" alt="">
                </div>
                <div class="info2-bottom">
                  <span class="info-ago">16小时前</span><span class="info-comment">50条评论</span>
                </div>
              </div>
            </cell-box>
            <cell-box>
              <div>
                <video src="../../../static/video/movie.ogg" controls="controls" class="video"></video>
                <div class="video-tit"><span>JUUL电子烟套装评测：真那么好抽？</span></div>
                <div class="video-bottom">
                  <span class="video-date">2019-01-01<span class="video-time">09:00</span></span>
                  <span class="video-play"><span class="video-num">1万</span>次播放</span>
                </div>
              </div>
            </cell-box>
          </group>
        </div>
      </div>
    </div>
</template>

<script>
  import { Search } from 'vux'
  import { getArticleList} from '@/api/home'
    export default {
        name: "information",
      methods:{
          back(){
            this.$router.go(-1)
          },
        change1(){
            this.flag1=true;
            this.flag2=false;
            this.flag3=false;
            this.flag4=false;
            this.flag5=false;
            this.flag6=false;
        },
        change2(){
          this.flag1=false;
          this.flag2=true;
          this.flag3=false;
          this.flag4=false;
          this.flag5=false;
          this.flag6=false;
        },
        change3(){
          this.flag1=false;
          this.flag2=false;
          this.flag3=true;
          this.flag4=false;
          this.flag5=false;
          this.flag6=false;
        },
        change4(){
          this.flag1=false;
          this.flag2=false;
          this.flag3=false;
          this.flag4=true;
          this.flag5=false;
          this.flag6=false;
        },
        change5(){
          this.flag1=false;
          this.flag2=false;
          this.flag3=false;
          this.flag4=false;
          this.flag5=true;
          this.flag6=false;
        },
        change6(){
          this.flag1=false;
          this.flag2=false;
          this.flag3=false;
          this.flag4=false;
          this.flag5=false;
          this.flag6=true;
        },
        touch(){
            this.touch1=true;
        },
        onCancel(){
            this.touch1=false;
        },
        getArticleList(){
         getArticleList({}).then(res=>{
           console.log(res);
         })
        }
      },
      data(){
        return{
          flag1:true,
          flag2:false,
          flag3:false,
          flag4:false,
          flag5:false,
          flag6:false,
          touch1:false
        }
      },
      components:{
        Search
      },
      created(){
          this.getArticleList();
      }
    }
</script>

<style scoped>
  #header{
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
  }
  .active1{
    font-weight: bolder;
  }
  .info{
    display: flex;
    justify-content: space-between;
  }
  .info-left{
    width: 59.2%;
    display: flex;
    flex-direction: column;
  }
  .info-bottom{
    display: flex;
    flex-direction: row;
    margin-top: 0.71rem;
  }
  .info-tit{
    font-size: 18px;
    color: #030303;
    letter-spacing: -0.43px;
    text-align: justify;
  }
  .info-ago{
    font-size: 12px;
    color: #9B9B9B;
    letter-spacing: -0.29px;
    text-align: justify;
  }
  .info-comment{
    margin-left: 1.07rem;
    font-size: 12px;
    color: #9B9B9B;
    letter-spacing: -0.29px;
    text-align: justify;
  }
  .info-right{
    margin-left: 1.07rem;
  }
  .info-right img{
    width: 7.86rem;
    height: 5.71rem;
  }
  .info2{
    display: flex;
    flex-direction: column;
  }
  .info2-img{
    margin-top: 1.07rem;
  }
  .info2-img img{
    width: 7.86rem;
    height: 5.71rem;
  }
  .video{
    width: 24.64rem;
    height: 14.07rem;
    background: rgba(0,0,0,0.40);
    border-radius: 5px;
  }
  .video-tit{
    font-size: 18px;
    color: #030303;
    letter-spacing: -0.43px;
    text-align: justify;
    margin-top: 1.08rem;
  }
  .video-bottom{
    margin-top: 0.35rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
  .video-date{
    font-size: 12px;
    color: #9B9B9B;
    letter-spacing: 0;
    text-align: justify;
  }
  .video-time{
    margin-left: 0.36rem;
  }
  .video-play{
    font-size: 12px;
    color: #9B9B9B;
    letter-spacing: -0.29px;
    text-align: justify;
  }
  .video-num{
    font-size: 12px;
    color: #4A4A4A;
    letter-spacing: -0.29px;
    text-align: justify;
    margin-right: 0.36rem;
  }
</style>
